#ifndef _GAME_FSM_H_
#define _GAME_FSM_H_

#include <Game/GameState.h>
#include <Game/GameStartState.h>
#include <Game/GameExitState.h>

namespace pp
{
    class GameFSM : public ne::FiniteStateMachine<Game>
    {
        public:
            explicit GameFSM(Game *pContent)
                : ne::FiniteStateMachine<Game>(pContent)
            {
            }

            virtual GameState* createState(const uint32_t stateID)
            {
                GameState *pState = 0;
                switch (stateID)
                {
                    case ne::FINITE_STATE_MACHINE_DEFAULT_STATE_ID:
                    {
                        pState = createDefaultState();
                        break;
                    }

                    case GAME_START_STATE_ID:
                    {
                        pState = new GameStartState(mpContent);
                        break;
                    }

                    case GAME_EXIT_STATE_ID:
                    {
                        pState = new GameExitState(mpContent);
                        break;
                    }

                    default:
                    {
                        pState = createDefaultState();
                        break;
                    }
                }
                return pState;
            }

            virtual GameState* createDefaultState()
            {
                return new GameStartState(mpContent);
            }

            virtual ~GameFSM()
            {
            }
    };
}

#endif
